Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MUSICA Tutorial Chapter 1 #132

Merged
merged 45 commits into from
Jun 11, 2024
Merged

MUSICA Tutorial Chapter 1 #132

merged 45 commits into from
Jun 11, 2024

Conversation

dwfncar
Copy link
Contributor

@dwfncar dwfncar commented May 29, 2024

Tutorial Chapter 1, linking a fortran program to the MUSICA library.,
Added get_micm_version function to the fortran interface.

Copy link
Collaborator

@K20shores K20shores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

CMakeLists.txt Outdated
@@ -70,6 +70,7 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
list(APPEND musica_compile_definitions MUSICA_USING_PGI)
endif()
set(CMAKE_Fortran_FLAGS "-fPIE")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we need to set this, then please set it with [target_compile_options](https://cmake.org/cmake/help/latest/command/target_compile_options.html) on the appropriate target (musica fortran?). This prevents us from polluting downstream builds with options that they may not want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've taken this out for now ... I don't understand why I needed it on one Linux OS (RedHat) with GCC 13.2 but not on another (Ubuntu) with GCC 11.4.

docs/source/getting_started/overview.rst Outdated Show resolved Hide resolved
dwfncar and others added 2 commits May 29, 2024 19:22
@dwfncar dwfncar requested a review from K20shores May 30, 2024 15:42
Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just one question and one suggestion.

docs/source/user_guide/fortran_c.rst Show resolved Hide resolved
Comment on lines 14 to 21
program demo
use musica_util, only: string_t
use musica_micm, only: get_micm_version
implicit none
type(string_t) :: micm_version
micm_version = get_micm_version()
print *, "MICM version ", micm_version%get_char_array()
end program demo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest that we move all the tutorial code snippets to separate source code files that get compiled and run as tests. This way we can ensure that if we break a part of the tutorial with updates to the MUSICA source code, a test will fail.

We do something similar in MICM:

https://github.com/NCAR/micm/blob/ee5c03e904d9dc3d60619dc9dbce06232bd32852/docs/source/user_guide/rate_constant_tutorial.rst?plain=1#L46-L49

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let me do that ...

Copy link
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the overview!

@dwfncar dwfncar self-assigned this Jun 3, 2024
@dwfncar dwfncar requested a review from mattldawson June 4, 2024 17:41
Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better! Just one last comment

Comment on lines 1 to 8
program test_get_micm_version
use musica_util, only: string_t
use musica_micm, only: get_micm_version
implicit none
type(string_t) :: micm_version
micm_version = get_micm_version()
print *, "MICM version ", micm_version%get_char_array()
end program test_get_micm_version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I would just now pull the content of this test directly into the tutorial so they don't get out-of-sync. Similar to this:
https://github.com/NCAR/micm/blob/ee5c03e904d9dc3d60619dc9dbce06232bd32852/docs/source/user_guide/rate_constant_tutorial.rst?plain=1#L46-L49

Also, I would move this to a test/tutorial/ folder or something similar

@dwfncar
Copy link
Contributor Author

dwfncar commented Jun 11, 2024

Now using literal include for test_get_micm_version.F90 in Chapter 1.
Creating of test/tutorial subdir and CMakeList files to move to Chapter 0 issue.

@dwfncar dwfncar requested a review from mattldawson June 11, 2024 15:43
Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@dwfncar dwfncar merged commit d09c3be into main Jun 11, 2024
34 of 55 checks passed
@dwfncar dwfncar deleted the develop-host-model branch June 11, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial Ch 1: Add build instructions tutorial for MUSICA integration
4 participants